//
//  DHUser_HomePage_FollowCell.m
//  Dresshere
//
//  Created by ZhangPeng on 2018/6/18.
//  Copyright © 2018年 张朋. All rights reserved.
//

#import "DHUser_HomePage_FollowCell.h"
#import "DHUser_HomePage_Follow_ItemCell.h"

@interface DHUser_HomePage_FollowCell()<UITableViewDelegate, UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (weak, nonatomic) IBOutlet UIView *searchView;
@property (weak, nonatomic) IBOutlet UITextField *searchTF;

@property (strong, nonatomic) NSMutableArray *arr;

@end

@implementation DHUser_HomePage_FollowCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.searchView.layer.cornerRadius = self.searchView.height / 2;
    
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    [self.tableView registerNib:[UINib nibWithNibName:@"DHUser_HomePage_Follow_ItemCell" bundle:nil] forCellReuseIdentifier:kDHUser_HomePage_Follow_ItemCell];
}

- (void)updateCellArr:(NSMutableArray *)arr{
    self.arr = arr;
    [self.tableView reloadData];
}

#pragma mark - tableview
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.arr.count;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 60;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    DHUser_HomePage_Follow_ItemCell *cell = [tableView dequeueReusableCellWithIdentifier:kDHUser_HomePage_Follow_ItemCell forIndexPath:indexPath];
    [cell updateCell:self.arr[indexPath.row]];
    return cell;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
